package com.wlc.mapper;

import com.wlc.pojo.Menu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface MenuMapper {

    Long selectMenuCount(@Param("name") String name,
                         @Param("type") Integer type);

    List<Menu> selectMenuList(@Param("name") String name,
                              @Param("type") Integer type,
                              @Param("offset") Integer offset,
                              @Param("limit") Integer limit);
    Menu selectById(Long id);
    List<Menu> selectAll();
    List<Menu> selectByParentId(Long parentId);
    List<Menu> selectByType(Integer type);
    List<Menu> selectTree();
    List<Menu> selectByUserId(Long userId);
    List<String> selectPermsByUserId(Long userId);
    int insert(Menu menu);
    int update(Menu menu);
    int deleteById(Long id);  // 改为物理删除
    boolean existsChildren(Long parentId);
}